#ifndef HISTORY_H
#define HISTORY_H

#include <deque>
#include <vector>
#include <string>
#include "CountingSemaphore.h"

using namespace std;

struct Reading
{
	Reading(int t = 0, int v = 0) : timestamp(t), value(v) {};

	int timestamp;
	int value;
};

class History
{
private:
	CountingSemaphore _semaphore;
	deque<Reading> _data;
public:
	History();
	~History();

	void store(Reading r);
	vector<Reading> tail(const int i, int base);
	void print(int n);
	bool readFile(string filename);
};

#endif 
